package com.dxtan90.utils;


import java.awt.*;

/**
 * @author: shijunhao
 * @date: 2021/12/1 23:12
 * @description:
 */
public class RobotUtils {
    //机器robot
    private volatile static Robot robot = null;

    public static Robot getRobot(){
        if(robot == null){
            synchronized (Robot.class){
                if(robot == null){
                    try {
                        robot = new Robot();
                    } catch (AWTException e) {
                        e.printStackTrace();
                        System.out.println("获取Robot失败");
                    }
                }
            }
        }
        return robot;
    }

}
